/*
    Flood is a program to test the cut method on soft constraints problems
    Copyright (C) 2011  Mattia Gamba

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef GRAPH_H
#define GRAPH_H

#include <qframe.h>
#include "solver.h"
#include <qlayout.h>
#include <qwt_plot.h>
#include <qwt_plot_marker.h>
#include <qwt_plot_curve.h>
#include <qwt_legend.h>
#include <qwt_plot_canvas.h>
#include <qwt_plot_panner.h>
#include <qwt_plot_magnifier.h>

class GPlot : public QwtPlot
{
public:
    GPlot(bool constraint, int steps, QVector<Solution>& results, bool den,int minden, int maxden, bool tigh,
          int mintight, int maxtight, int cpuMax, bool cutsjumps = false, int maxcut = 0,
          int maxjump = 0, QWidget *parent = NULL);

protected:
    virtual void resizeEvent( QResizeEvent * );

private:
    void populate(QVector<Solution>& results, bool den, bool tigh, int steps, int min);
    void populate_cj(QVector<Solution>& results, bool den, bool tigh, int steps, int min);
    void updateGradient();
};
#endif // GRAPH_H
